package br.com.yuri.addressbar.gwt.client;

import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ui.VButton;

public class VSearchButton extends VButton implements Paintable{

	private String uidlId;

    private ApplicationConnection client;
	
	public VSearchButton(){
		super();
	}

	@Override
	public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
		super.updateFromUIDL(uidl, client);
		this.uidlId = uidl.getId();
		this.client = client;
		setAddress(uidl.getStringAttribute("address"));
	}
	
	public void setAddress(String address) {
		if (uidlId == null || client == null) {
            return;
        }
		
		
		
		 client.updateVariable(uidlId, "colorname", address, true);
	}

	

}
